import axios from 'axios'

export const findSupplierList = (current, size, supplierVo) => {
  return axios({
    url: '/api/supplier/findSupplierList',
    method: 'post',
    /*localhost:8080/user?id=  方式传值*/
    params: {
      current,
      size
    },
    /*json数据传值*/
    data: supplierVo
  })
}

//获取所有来源
export const getAllSupplierList = () => {
  return axios({
    url: '/api/supplier/getAllSupplierList',
    method: 'get',
  })
}

//删除来源
export const deleteSupplierById = (id) => {
  return axios({
    url: '/api/supplier/deleteSupplierById',
    method: 'delete',
    params: {
      id
    },
  })
}

//添加来源
export const addSupplier = (supplier) => {
  return axios({
    url: '/api/supplier/addSupplier',
    method: 'post',
    data: supplier
  })
}

//修改来源
export const updateSupplier = (supplier) => {
  return axios({
    url: '/api/supplier/updateSupplier',
    method: 'post',
    data: supplier
  })
}

//获取省市区县信息
export const getProvinces = () => {
  return axios({
    url: '/api/json/provinces.json',
    method: 'get',
  })
}
